<template>
  <div class="address-book-container">
    <el-card class="address-card">
      <template #header>
        <div class="card-header">
          <h2>地址簿</h2>
          <el-button type="primary">
            <el-icon><Plus /></el-icon>新增地址
          </el-button>
        </div>
      </template>
      
      <div class="address-search">
        <el-input v-model="searchQuery" placeholder="搜索联系人或地址" clearable>
          <template #prefix>
            <el-icon><Search /></el-icon>
          </template>
        </el-input>
      </div>
      
      <div class="address-tabs">
        <el-radio-group v-model="addressType" size="large">
          <el-radio-button label="sender">寄件地址</el-radio-button>
          <el-radio-button label="receiver">收件地址</el-radio-button>
        </el-radio-group>
      </div>
      
      <div class="empty-placeholder" v-if="!hasData">
        <el-empty description="暂无地址数据"></el-empty>
      </div>
    </el-card>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { Search, Plus } from '@element-plus/icons-vue'

const searchQuery = ref('')
const addressType = ref('sender')
const hasData = ref(false)
</script>

<style scoped>
.address-book-container {
  padding: 20px;
}

.address-card {
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.address-search {
  margin: 20px 0;
  max-width: 400px;
}

.address-tabs {
  margin: 20px 0;
}

.empty-placeholder {
  margin: 60px 0;
}
</style> 